package Task3;

public class FruitTest {
    public static void main(String[] args) {
     Fruit fruit  =  new Fruit("苹果","昭通",5);
        System.out.println("名称:"+ fruit.getName() + "\n产地：" + fruit.getArea() + "\n单价："+ fruit.getPrice() +"\n");

     Fruit banana = new Fruit("香蕉","海南",2);
        System.out.println("名称:"+banana.getName() + "\n产地：" + banana.getArea() + "\n单价："+ banana.getPrice()  +"\n");

        Fruit yzi =  new Fruit("椰子","海南",20);
        System.out.println("名称:"+ yzi.getName() + "\n产地：" + yzi.getArea() + "\n单价："+ yzi.getPrice()  +"\n");

        // 修改属性值
        //fruit.setName("Red Apple");
       // fruit.setPrice(3.0);

         // 再次打印，查看修改后的结      System.out.println(fruit);
    }
}
